﻿using System;
using System.Linq.Expressions;
using MoroMoro.Samples.ToDoList.Base.Domain.Viewpoints;

namespace MoroMoro.Samples.ToDoList.Domain.Categories
{
    /// <summary>
    /// <see cref="Category">カテゴリ</see>の<see cref="Category.Name">名前</see>を分析します。
    /// </summary>
    [Serializable]
    public sealed class CategoryNameViewpoint : Viewpoint<Category, string>
    {
        /// <inheritdoc/>
        protected override Expression<Func<Category, string>> CreateExpression()
        {
            return entity => entity.Name;
        }
    }
}
